<template>
<div class="big">
    <div class="container">
        <!-- 轮播图-->
        <div class="active1 mb-20 module-bgc">
            <div class="swiper">
                <div class="block">
                    <el-carousel style="overflow:hidden !important;" trigger="click" height="321px" class="carousel-width">
                        <el-carousel-item v-for="item in imgListRotation.slice(0,5)" :key="item.id" @click.native="PicToBanner(item)">
                            <div class="lbwenzi">{{item.title}}</div>
                            <div class="background-color" :style="{backgroundImage:'url(' + baseUrl+item.url+ ')', 
        backgroundRepeat:'no-repeat',backgroundSize: 'cover',backgroundPosition:'center'}"></div>

                        </el-carousel-item>
                    </el-carousel>
                </div>
            </div>
            <Login></Login>
        </div>
        <!-- 清风论坛图片-->
        <div class="banner mb-20 picFocus">
            <img :src="baseUrl+picFocus" alt :style="{'object-fit': 'cover'}" />
        </div>
        <!--亦廉课堂 -->
        <div class="ylkt clearfix mb-20 module-bgc">
            <div class="ylkt1 module-bgc">
                <div class="ylkt1Tit">
                    <span>亦廉课堂</span>
                    <div class="LinkTo-qflt" @click="Goylkt">更多</div>
                </div>
                <div class="ylkt1Img-pic-box">
                    <img class="ylkt1Img" :src="baseUrl+picFocus2" alt @click="GoDetail1" :id="0" :style="{'object-fit': 'cover'}" />
                </div>
                <ul class="ylkt1List">
                    <li v-for="item in ClassroomListylkt.slice(0,3)" :key="item.id">
                        <span @click="GoDetailylkt(item)" class="Link-detail" :id="item.id">{{item.title}}</span>
                    </li>
                </ul>
            </div>
            <div class="ylkt1 module-bgc">
                <div class="ylkt1Tit">
                    <span>他山之石</span>
                    <div class="LinkTo-qflt" @click="Gotszs">更多</div>
                </div>
                <div class="ylkt1Img-pic-box">
                    <img class="ylkt1Img" :src="baseUrl+picFocus3" alt @click="GoDetail2" :id="0" :style="{'object-fit': 'cover'}" />
                </div>
                <ul class="ylkt1List">
                    <li v-for="item in ClassroomListtszs.slice(0,3)" :key="item.id">
                        <span @click="GoDetailylkt(item)" class="Link-detail" :id="item.id">{{item.title}}</span>
                    </li>
                </ul>
            </div>
            <div class="ylkt1 module-bgc">
                <div class="ylkt1Tit">

                    <span>警示教育</span>
                    <div class="LinkTo-qflt" @click="Gosjjy">更多</div>
                </div>
                <div class="ylkt1Img-pic-box">
                    <img class="ylkt1Img" :src="baseUrl+picFocus4" alt @click="GoDetail2" :id="0" :style="{'object-fit': 'cover'}" />
                </div>
                <ul class="ylkt1List">
                    <li v-for="item in Classroomsjjy.slice(0,3)" :key="item.id">
                        <span @click="GoDetailsjjy(item)" class="Link-detail" :id="item.id">{{item.title}}</span>
                    </li>
                </ul>
            </div>
        </div>
        <!--人廉图片 -->
        <div class="banner mb-20">
            <div class="block banner mb-20 picFocus">
                <el-carousel trigger="click" height="120px" style="overflow:hidden !important;" arrow="never">
                    <el-carousel-item v-for="item in bannerPeop2" :key="item.id">
                        <img :src="baseUrl+item.picUrl" alt :key="item.id" :id="item.id" :style="{'object-fit': 'cover'}" />
                    </el-carousel-item>
                </el-carousel>
            </div>
        </div>
        <!--风险防控 -->
        <div class="fxfk mb-20 mt-20">
            <div class="fxfk1 module-bgc">
                <div class="fxfk1Tit">
                    <span class="fxfktitle">风险防控</span>
                    <span class="LinkTo-qflt" @click="GoRisk">更多</span>
                </div>
                <ul class="ylkt1List ylkt1List2 pt-10 pb-10">
                    <li v-for="item in listfxfk.slice(0,4)" :key="item.id">
                        <span @click="GoDetailfxfk(item)" class="float-left Link-detail" :id="item.id">{{item.title}}</span>
                        <span class="float-right list-time">{{item.publishTime}}</span>
                    </li>
                </ul>
            </div>

            <div class="fxfk1 module-bgc">
                <div class="fxfk1Tit">
                    <span class="fxfktitle">党纪法规</span>
                    <span class="LinkTo-qflt" @click="GoPartyDiscipline">更多</span>
                </div>
                <ul class="ylkt1List ylkt1List2 pt-10 pb-10">
                    <li v-for="item in listxts.slice(0,4)" :key="item.id">
                        <span @click="GoDetaildjfg(item)" class="float-left Link-detail" :id="item.id">{{item.title}}</span>
                        <span class="float-right list-time">{{item.publishTime}}</span>
                    </li>
                </ul>
            </div>
            <div class="fxfk1 module-bgc">
                <div class="fxfk1Tit">
                    <span class="fxfktitle">巡视巡察</span>
                    <span class="LinkTo-qflt" @click="GoMakeInspectionTou">更多</span>
                </div>
                <ul class="ylkt1List ylkt1List2 pt-10 pb-10">
                    <li v-for="item in listxcxs.slice(0,4)" :key="item.id">
                        <span @click="GoDetailjtdt(item)" class="float-left Link-detail" :id="item.id">{{item.title}}</span>
                        <span class="float-right list-time">{{item.publishTime}}</span>
                    </li>
                </ul>
            </div>
            <div class="fxfk1 module-bgc">
                <div class="fxfk1Tit">
                    <span class="fxfktitle">审查调查</span>
                    <span class="LinkTo-qflt" @click="GoInvestigate">更多</span>
                </div>
                <ul class="ylkt1List ylkt1List2 pt-10 pb-10">
                    <li v-for="item in listscdc.slice(0,4)" :key="item.id">
                        <span @click="GoDetailscdc(item)" class="float-left Link-detail" :id="item.id">{{item.title}}</span>
                        <span class="float-right list-time">{{item.publishTime}}</span>
                    </li>
                </ul>
            </div>
        </div>
        <!--举报电话 -->
        <div class="banner mb-20 picFocus">
            <img :src="baseUrl+reportpic" alt :style="{'object-fit': 'cover'}" />
        </div>
        <!--三张图片 -->
        <Swiper :list="threePic" :width="372" :height="90" newstyle=1></Swiper>
        <!--<div class="three-pic mb-20">
        <a href="http://guoqing70.cctv.com/" target="_blank">
          <img :src="Advertisement1" alt />
        </a>
        <a href="http://www.gov.cn/xinwen/2019-09/17/content_5430519.htm" target="_blank">
          <img :src="Advertisement2" alt />
        </a>
        <a href="http://www.mzhoudeng.com/" target="_blank">
          <img :src="Advertisement3" alt class="Last-pic" />
        </a>
      </div>-->
    </div>
    <!--友情链接 -->
    <div class="yqlj-bottom">
        <div class="yqlj">
            <div class="yqlj-title">友情链接</div>
            <Swiper :list="FriendPic" :width="180" :height="52" newstyle=2></Swiper>
        </div>
    </div>
    <Rqcode></Rqcode>
    <!--开屏动画-->
    <Open-screen v-if="showCover"></Open-screen>
</div>
</template>

<script>
import Login from "./Login/Login.vue";
import Swiper from "@/components/Swiper";
import Rqcode from "./Rqcode";
import OpenScreen from "@/components/OpenScreen"
export default {
    components: {
        Login,
        Swiper,
        Rqcode,
        OpenScreen
    },
    data() {
        return {
            //控制开屏动画
            showCover: false,
            isSecond: localStorage.getItem("isSecond"),
            PICsPACE: localStorage.getItem("picSpace"),
            //情分论坛列表
            ClassroomListylkt: [],
            ClassroomListtszs: [],
            Classroomsjjy: [],
            //分线防控
            listfxfk: [],
            //党纪法规
            listxts: [],
            //巡查巡视
            listxcxs: [],
            //审查调查
            listscdc: [],
            // 轮播投请求参数
            propmsRotation: {
                pageNum: "1",
                pageSize: "10",
            },
            imgListRotation: [],

            //清风论坛图片获取
            picFocus: "",
            paramspicFocus: {
                picCode: "FORUM_PIC",
            },
            picFocus2: "",
            paramspicFocus2: {
                picCode: "YL_CLASS",
            },
            picFocus3: "",
            paramspicFocus3: {
                picCode: "LEARN_OTHER",
            },
            picFocus4: "",
            paramspicFocus4: {
                picCode: "ARM_YOUSELF",
            },
            //banner图第二张人廉
            bannerPeop2: [],
            paramsbannerPeop2: {
                picCode: "BANNER1",
            },
            //举报单张图片
            reportpic: "",
            //三张图的轮播
            threeparams: {
                picCode: "BANNER2",
            },
            threePic: [],
            //友情链接
            FriendPic: [],
            //巡查巡视
            relation: 0,
            //集团
            listjt: [],
        };
    },
    computed: {
        baseUrl() {
            return this.$store.state.fileIp;
        },
    },
    created() {
        const {
            dispatch
        } = this.$store;
        dispatch("SET_FILEIP");
        //清风论坛图片获取
        this.Api.getforusPic(this.paramspicFocus).then((res) => {
            if (res.code == 0) {
                this.picFocus = res.data.picUrl;
                // console.log(this.ClassroomList2);
            }
        });
        this.Api.getforusPic(this.paramspicFocus2).then((res) => {
            if (res.code == 0) {
                this.picFocus2 = res.data.picUrl;
                // console.log(this.ClassroomList2);
            }
        });
        this.Api.getforusPic(this.paramspicFocus3).then((res) => {
            if (res.code == 0) {
                this.picFocus3 = res.data.picUrl;
                // console.log(this.ClassroomList2);
            }
        });
        this.Api.getforusPic(this.paramspicFocus4).then((res) => {
            if (res.code == 0) {
                this.picFocus4 = res.data.picUrl;
                // console.log(this.ClassroomList2);
            }
        });
        //清风论坛捯饬结束
        //人廉图片
        this.Api.getbanner(this.paramsbannerPeop2).then((res) => {
            if (res.code == 0) {
                this.bannerPeop2 = res.data;
                // console.log(this.ClassroomList2);
            }
        });
        //举报图片单个
        this.Api.getreport(this.paramsbannerPeop2).then((res) => {
            if (res.code == 0) {
                this.reportpic = res.data.picUrl;
                // console.log(this.ClassroomList2);
            }
        });
        //首页轮播图
        this.Api.getRotation(this.propmsRotation).then((res) => {
            if (res.code == 0) {
                this.imgListRotation = res.data.records;
                // console.log(this.imgListRotation[0].id,999);
            }
        });
        //三张图轮播
        this.Api.getbanner(this.threeparams).then((res) => {
            if (res.code == 0) {
                this.threePic = res.data;
                // console.log(this.ClassroomList2);
            }
        });
        //友情链接
        this.Api.getFriendList().then((res) => {
            if (res.code == 0) {
                console.log(res.data, "友情链接地址");
                this.FriendPic = res.data;
                // console.log(this.ClassroomList2);
            }
        });
        //亦廉课堂数据
        this.get();
        //学习他人，他山之石
        this.getStudy();
        //警示教育
        this.getJOIN();
        // 风险防控
        this.getsixiang();
        //小贴士
        this.getxts();
        //巡查巡视
        this.getxcxs();
        // 审查调查列表
        this.getscdc();
        this.getjt();
        this.showSecond()
    },

    methods: {
        //控制开屏动画次数
        showSecond() {
            if (!this.isSecond) {
                this.showCover = true;
                localStorage.setItem("isSecond", "true");
            }
        },
        get() {
            this.Api.getClassroom({
                pageNum: 1,
                pageSize: 10,
            }).then((res) => {
                this.ClassroomListylkt = res.data.records;
                // console.log(this.ClassroomListylkt)
            });
        },
        //学习他人
        getStudy() {
            this.Api.getoutside({
                pageNum: 1,
                pageSize: 10,
            }).then((res) => {
                this.ClassroomListtszs = res.data.records;
                // console.log(this.ClassroomList);
            });
        },
        //警示教育
        getJOIN() {
            this.Api.geteducation({
                pageNum: 1,
                pageSize: 10,
            }).then((res) => {
                this.Classroomsjjy = res.data.records;
                // console.log(this.Classroomsjjy);
            });
        },
        // 风险防控
        getsixiang() {
            this.Api.getBisk({
                pageNum: 1,
                pageSize: 10,
            }).then((res) => {
                if (res.code == 0) {
                    this.listfxfk = res.data.records;
                }
            });
        },
        //小贴士
        getxts() {
            this.Api.getLawListdangji({
                pageNum: "1",
                pageSize: "4",
                sortCode1: "",
                sortCode2: "",
            }).then((res) => {
                if (res.code == 0) {
                    // console.log(res);
                    this.listxts = res.data.records;
                }
            });
        },
        //巡查巡视beijing动态
        // 集团列表
        getjt() {
            this.Api.getGroup().then((res) => {
                if (res.code == 0) {
                    this.listjt = res.data;
                    // console.log("" + this.list[0].id);
                    (this.relation = this.listjt[0].id),
                    // console.log(this.relation,1212)
                    this.getxcxs();
                }
            });
        },
        getxcxs() {
            this.Api.getGroup1({
                pageNum: "1",
                pageSize: "10",
                relation: this.relation,
            }).then((res) => {
                if (res.code == 0) {
                    this.listxcxs = res.data.records;
                    // console.log(res,22332)
                }
            });
        },
        // 审查调查列表
        getscdc() {
            this.Api.getDj({
                pageNum: 1,
                pageSize: 10,
            }).then((res) => {
                if (res.code == 0) {
                    this.listscdc = res.data.records;
                    // console.log(this.listscdc, 1212);
                }
            });
        },
        Goylkt() {
            this.$router.push("/forum/forumClassroom");
        },
        Gotszs() {
            this.$router.push("/forum/forumOutside");
        },
        Gosjjy() {
            this.$router.push("/forum/forumWarning");
        },
        GoRisk() {
            this.$router.push("/Risk/SiXiang");
        },
        GoPartyDiscipline() {
            this.$router.push("/PartyDiscipline/FenLei");
        },
        GoMakeInspectionTou() {
            this.$router.push("/MakeInspectionTour/JiTuan");
        },
        GoInvestigate() {
            this.$router.push("/Investigate/DangJi");
        },
        //亦廉课堂，他山之石，示警教育详情链接
        GoDetail1(e) {
            var itemID = e.currentTarget.id;
            // console.log(this.obj[itemID])
            this.$router.push(this.obj1[itemID].RouteingPath);
        },
        GoDetail2(e) {
            var itemID = e.currentTarget.id;
            // console.log(this.obj[itemID])
            this.$router.push(this.obj2[itemID].RouteingPath);
        },
        GoDetail3(e) {
            var itemID = e.currentTarget.id;
            // console.log(this.obj[itemID])
            this.$router.push(this.obj3[itemID].RouteingPath);
        },
        //首页风险防控，党纪法规，巡视巡察，审查调查的列表跳转
        GoDetail21(e) {
            var itemID = e.currentTarget.id;
            // console.log(this.obj[itemID])
            this.$router.push(this.obj21[itemID].RouteingPath);
        },
        GoDetail22(e) {
            var itemID = e.currentTarget.id;
            this.$router.push(this.obj22[itemID].RouteingPath);
        },
        GoDetail23(e) {
            var itemID = e.currentTarget.id;
            this.$router.push(this.obj23[itemID].RouteingPath);
        },
        GoDetail24(e) {
            var itemID = e.currentTarget.id;
            this.$router.push(this.obj24[itemID].RouteingPath);
        },
        GoDetail() {
            //备用
            this.$router.push("/Detail");
        },
        //轮播图跳转
        PicToBanner(item) {
            // console.log(item, 22222);
            this.$router.push({
                name: "DetailBanner",
                query: {
                    id: item.id,
                },
            });
        },
        //tasahn之石点击事件
        GoDetailylkt(item) {
            let ID = {
                id: item.id,
            };
            this.$router.push({
                name: "DetailStudy",
                params: {
                    id: item.id,
                },
            });
        },
        //示警教育点击事件
        GoDetailsjjy(item) {
            let ID = {
                id: item.id,
            };
            this.$router.push({
                name: "DetailEducation",
                params: {
                    id: item.id,
                },
            });
        },
        //一联课堂点击事件
        GoDetailylkt(item) {
            let ID = {
                id: item.id,
            };
            this.$router.push({
                name: "DetailText",
                params: {
                    id: item.id,
                },
            });
        },
        //风险防控事件
        GoDetailfxfk(item) {
            let ID = {
                id: item.id,
            };
            // console.log(ID, 22222);
            this.$router.push({
                name: "SX",
                query: {
                    id: item.id,
                },
            });
        },
        //党纪法规小贴士
        GoDetaildjfg(item) {
            let ID = {
                id: item.id,
            };
            // console.log(ID, 22222);
            this.$router.push({
                name: "XtsDetail",
                query: {
                    id: item.id,
                },
            });
        },
        //生茶调查
        GoDetailscdc(item) {
            // console.log(item);
            this.$router.push({
                name: "Detail1",
                query: {
                    id: item.id,
                },
            });
        },
        //集团动态
        GoDetailjtdt(item) {
            // console.log(item);
            this.$router.push({
                name: "Jt1",
                query: {
                    id: item.id,
                },
            });
        },
    },
};
</script>

<style lang="less" scoped>
.container {
    width: 1200px;
    margin: 0 auto;
    background: rgba(242, 242, 242, 1);
    margin-top: 10px;
}

.big {
    background: rgba(242, 242, 242, 1);
}

.module-bgc {
    background-color: white;
}

.active1 {
    display: flex;
    padding: 20px;
}

img {
    width: 794px;
    height: 321px;
}

.banner {
    width: 1200px;
    margin: 0 auto;
}

.banner img {
    width: 100%;
    height: 120px;
}

.mb-20 {
    margin-bottom: 20px;
}

/*轮播图*/
.el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 150px;
    margin: 0;
}

.el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
    background-color: #d3dce6;
}

.carousel-width {
    width: 794px;
}

.carousel-width img {
    cursor: pointer;
}

/deep/.el-carousel__indicator--horizontal {
    background-color: red;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0);
}

/deep/.el-carousel__button {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 1);
    border-radius: 50%;
}

/deep/.el-carousel__indicators {
    margin-left: 296px;
}

.lbwenzi {
    position: absolute;
    bottom: 0px;
    width: 782px;
    height: 48px;
    font-size: 18px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: rgba(255, 255, 255, 1);
    line-height: 48px;
    background-color: rgba(0, 0, 0, 0.7);
    padding-left: 12px;
}

/deep/.is-active {
    border-bottom: 0px;
}

/*亦廉课堂*/
.ylkt {
    /*padding: 20px 0;*/
    display: flex;
    justify-content: space-between;
    background: rgba(242, 242, 242, 1);
}

.ylkt1 {
    width: 388px;
    padding-bottom: 14px;
}

.ylkt1Tit {
    color: #dd2126;
    font-size: 18px;
    margin-bottom: 10px;
    margin-left: 20px;
    margin-right: 20px;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 47px;
    border-bottom: 1px solid #dddddd;
}

.ylkt1Tit span {
    border-bottom: 2px solid #dd2126;
    line-height: 47px;
}

.ylkt1Tit a {
    /*float: right;*/
    color: #989898;
    text-decoration: none;
    font-size: 14px;
}

.ylkt1Img {
    width: 348px;
    height: 180px;
    margin-top: 10px;
    height: 180px;
    padding-left: 20px;
    margin-bottom: 8px;
    cursor: pointer;
}

.ylkt1List {
    margin-top: 9px;
}

.ylkt1List li .Link-detail {
    color: #333;
    font-size: 16px;
    text-decoration: none;
    line-height: 32px;
    cursor: pointer;
    display: block;
    width: 348px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ylkt1List li {
    padding-bottom: 6px;
    padding-left: 20px;
}

.ylkt1List li span:first-child:hover {
    color: red;
}

.LinkTo-qflt {
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: rgba(153, 153, 153, 1);
    cursor: pointer;
}

.LinkTo-qflt:hover {
    color: red;
}

/*风险防控*/
.fxfk {
    overflow: hidden;
    margin-bottom: 20px;
}

.fxfk1 {
    width: 595px;
    margin-bottom: 10px;
    box-sizing: border-box;
    float: left;
    padding-right: 20px;
    padding-top: 17px;
}

.fxfk1:nth-child(2n + 1) {
    margin-right: 10px;
}

.fxfk1Tit {
    background: url(../../assets/image/titlebg.png) left center no-repeat;
    background-size: 130px 41px;
    background-position: 0px 0px;
    height: 41px;
    line-height: 41px;
    color: #fff;
    font-size: 20px;
    margin-left: 20px;
    border-bottom: 1px solid #dddddd;
}

.fxfk1Tit span:last-child {
    float: right;
    color: #999;
    font-size: 14px;
    line-height: 41px;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.fxfk1Tit span:last-child:hover {
    color: red;
}

.ylkt1List2 {
    height: 150px;
}

.ylkt1List2 li {
    overflow: hidden;
}

.ylkt1List2 li a {
    display: block;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.pl-20 {
    padding-left: 20px;
}

.pr-20 {
    padding-right: 20px;
}

.pt-10 {
    padding-top: 10px;
}

.pb-10 {
    padding-bottom: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.float-left {
    float: left;
}

.float-right {
    float: right;
}

.float-right.list-time {
    font-size: 16px;
    line-height: 22px;
    color: rgba(153, 153, 153, 1);
}

.fxfktitle {
    padding-left: 20px;
}

/*三张图片、广告*/
.three-pic {
    display: flex;
    justify-content: center;
    background-color: white;
    padding: 20px;
}

.three-pic a {
    display: block;
}

.three-pic>a>img {
    width: 372px;
    height: 90px;
    margin-right: 22px !important;
}

.three-pic .Last-pic {
    margin-right: 0px !important;
}

/*友情链接*/
.yqlj-bottom {
    width: 100%;
    background-color: white;
    height: 199px;
}

.yqlj {
    width: 1200px;
    margin: 0 auto;
}

.yqlj ul li a img {
    width: 180px;
    height: 52px;
}

.yqlj-title {
    font-size: 18px;
    color: rgba(51, 51, 51, 1);
    line-height: 90px;
    font-weight: 600;
}

.yqlj ul {
    display: flex;
    justify-content: space-between;
    padding-bottom: 20px;
}

//情分论坛图片的大小
.picFocus {
    width: 1200px;
    height: 120px;
}

.ylkt1Img-pic-box {
    width: 348px;
    height: 180px;
    overflow: hidden;
}

.background-color {
    width: 795px;
    height: 320px;
    cursor: pointer;
}
</style>
